package com.xiaoxu.yihaoShop.PVJob;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * keyIn
 *  类型：LongWritable
 *  偏移量：第一行（0） 第二行（第一行.length）
 *
 * valueIn
 *  类型：Text
 *
 *  keyOut
 *      类型：Text
 *      作为reduce的keyIn
 *
 *  valueOut
 *      类型：LongWritable
 *      作为reduce的valueIn
 */
public class PVMapper extends Mapper<LongWritable, Text, Text,LongWritable> {
    //
    private LongWritable ONE = new LongWritable(1);
    //
    private Text KEY = new Text("key");


    //
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        //System.out.println("map");
        //
        context.write(KEY,ONE);
    }
}
